package cn.ym.mall.dao;


import cn.ym.mall.entity.Contract;

import java.sql.SQLException;
import java.util.List;

public interface ContractDao {
    /**
     * 获得所有合同(带分页信息)
     * @param pageNo
     * @param pageSize
     * @return
     * @throws SQLException
     */
    public List<Contract> getAll(Integer pageNo, Integer pageSize) throws SQLException;

    /**
     * 添加新合同
     * @param contract
     * @return
     * @throws SQLException
     */
    public int add(Contract contract) throws SQLException;

    /**
     * 根据合同编号查询合同
     * @param coid 合同编号(id)
     * @return
     * @throws SQLException
     */
    public Contract getContractByCoid(Integer coid) throws SQLException;

    /**
     * 根据商店编号查询合同
     * @param sid   商店编号(id)
     * @return
     * @throws SQLException
     */
    public Contract getContractBySid(Integer sid) throws SQLException;

    /**
     * 合同总数
     * @return
     * @throws SQLException
     */
    public long getCount() throws SQLException;

}
